﻿<html>
<head>
	 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>试过才知道</title>

    <!--<link href="css/bootstrap.css" rel="stylesheet">-->
	<!--<link href="css/bootstrap-responsive.min.css" rel="stylesheet">-->
	<link href="css/productlist.css" rel="stylesheet">
	<link href="css/inspiritas.css" rel="stylesheet">
	<link href="css/carousel.css" rel="stylesheet">
	<script src="js/jquery-1.7.1.min.js"></script>
	<script src="js/jquery.form.js"></script>
    <script src="js/jquery.json-2.4.js"></script>
    <script src="js/jquery.cookie.js"></script>
    <script src="js/bootstrap.min.js"></script>
	<script>
	$(document).ready(	
		function()
		{
			typeListClick();
			<?php include "htm/ready.htm";?>
			
			$.ajax({
				url:'index.php?act=search.available_discount',
				type:'POST',
				success:function(data){
					//alert(data);
				}
			});
			
			$.getJSON('index.php?act=productlist.my_original_category',function(data){
			for(category in data)
			{
				html='<li >'+
						'<a style="TEXT-DECORATION:none" style="TEXT-DECORATION:none" href="'+'parenttypelist.php?product_category='+data[category].first_child_id+'">'+data[category].original_name+'</a> '+
						'</li>';
						$('#category_list').append(html);
			}
			
			});

			$.getJSON('index.php?act=search.available_discount',function(data){
			var i=0;
			for(var discount in data)
			{
				if(i==0)
				{
					html='<div class="item active">'+
					'<a href="discountresult.php?discount_id='+data[discount].ID+'">'+
                	'<img src="'+data[discount].ImagePath+'" alt="">'+
					'</a>'+
                	'<div class="carousel-caption">'+
                  	'<h4>'+data[discount].Name+'</h4>'+
                 	'<p>'+data[discount].Description+'</p>'+
                	'</div>'+
              		'</div>';
              	}
				else
				{
					html='<div class="item">'+
					'<a href="discountresult.php?discount_id='+data[discount].ID+'">'+
                	'<img src="'+data[discount].ImagePath+'" alt="">'+
					'</a>'+
                	'<div class="carousel-caption">'+
                  	'<h4>'+data[discount].Name+'</h4>'+
                 	'<p>'+data[discount].Description+'</p>'+
                	'</div>'+
              		'</div>';
				}
				i=i+1;
				$('#discount_list').append(html);
			}
			var b=0;			
			for(a=0;a<i;a++)
			{
				
				if(b==0)
				{
					html='<li data-target="#sale-ads" data-slide-to="'+b+'" class="active"></li>'
				}
				else
				{
					html='<li data-target="#sale-ads" data-slide-to="'+b+'" class=""></li>'
				}
				b=b+1;
				$('#discount_num').append(html);
				
			}
				

			});
		}
	);
	
	function typeListClick()
	{
		$('#type-list').children(':not(".divider,h2")').click(function(){
			$(this).addClass('active');
			$(this).siblings().removeClass('active');
		});
	}
	</script>
</head>
<body>

<?php include "htm/head.htm";?>

<div class="container-fluid">

  <div class="row-fluid">
    <div class="span3 ">
      <ul class="nav  nav-pills nav-stacked">
        <h3><div id="original_category" class="nav-header">书籍分类</div></h3>
       
	   <div id="category_list"> </div>
      </ul>
      <div class="well">
        <p>
          <b></b> 欢迎来到一人一本</p>
      </div>
    </div>
    <div class="span9">
	  <div class="hero-unit">
              <div id="sale-ads" class="carousel slide">
                <ol id="discount_num" class="carousel-indicators">
                </ol>
                <div id="discount_list" class="carousel-inner">
				</div>
                <a class="left carousel-control" href="#sale-ads" data-slide="prev">‹</a>
                <a class="right carousel-control" href="#sale-ads" data-slide="next">›</a>
              </div>
		</div>
    </div>
  </div>
<?php include "htm/footer.htm";?>
<?php include "htm/copyright.htm";?>
</div>



</body>
</html>